Repository navigation
refactor: consolidate repeated test and benchmark setup - #314
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add and use shared median bench/statistics.mjs, bench/data-url-bench.mjs, bench/reading-order-bench.mjs |
bench/statistics.mjs exports median(samples). Both benchmarks import it instead of defining local median functions. |
HTTP Test Fetch Helper
| Layer / File(s) | Summary |
|---|---|
Share noStreamFetch tests/mcp-http.test.ts |
The test file adds noStreamFetch, which keeps GET requests pending until aborted and delegates other methods to fetch. Two tests now use the shared helper. |
Navigation Dialog Test Helpers
| Layer / File(s) | Summary |
|---|---|
Share crawl setup and checks tests/navigation-dialogs.test.ts |
The file adds prepareCrawl and checkCrawl. Three tests use them for crawl setup, completion checks, assertions, and cleanup. |
HTML Compression Test Helper
| Layer / File(s) | Summary |
|---|---|
Share Chromium compression setup tests/utils.test.ts |
The file adds compressHtml and uses it in seven integration tests. Their existing compression and preservation assertions remain. |
Forwarding Transport Test Helper
| Layer / File(s) | Summary |
|---|---|
Add and use forwardTransport tests/transportFixture.ts, tests/vscode-host-recipient.test.ts, tests/webmcp-proxy.test.ts |
The fixture adds forwardTransport. Two tests use it to observe tool responses and trigger provider switches. |
Priority:
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Refactor
Possibly related PRs
- JustasMonkev/mcp-accessibility-scanner#301: Adds the data URL benchmark that this change updates to use the shared median function.
Suggested reviewers: claude
Merge Risk: 
Minimal · up to fe9a6
-
No merge-blocking risk is established for the test and benchmark refactor.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "refactor: consolidate repeated test and benchmark setup" matches the main change. The PR moves repeated test and benchmark setup into shared helpers. These include median in statistics.mjs, forwardTransport in transportFixture.ts, and shared crawl and HTML compression helpers. The title is concise, specific, and follows conventional commit style. Scope is limited to tests and two benchmark scripts, with no production behavior changes, which the title accurately reflects.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 9 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Summary
Keep scenario assertions, provider-switch conditions, timeout budgets, and benchmark timing loops explicit. No production behavior or public API changes.
Evidence
After: shared helpers preserve those operations and all existing assertions.
npm test: 72 files passed, 2 skipped; 1,852 tests passed, 5 skipped.npm run lint,npm run build, and the slop checker passed.node bench/data-url-bench.mjsandnode bench/reading-order-bench.mjscompleted with their built-in correctness assertions passing.Merge Danger
Door: two-way
Revert-only refactor; no data or configuration migration.
Blast Radius: tests
Shared fixtures affect the named regression suites; the shared median affects two benchmark reports. Message forwarding remains synchronous, and crawl cleanup still closes the context before awaiting the audit.
Summary by CodeRabbit


Confidence Score: 5/5
The PR appears safe to merge; the shared helpers preserve the existing test and benchmark behavior.Summary
This PR shares repeated test setup and benchmark code without changing production behavior.
No actionable issues found. This review used source inspection; tests and benchmarks were not run.
Reviews (1) · Last reviewed commit: "refactor: consolidate repeated test and ..." · Reviewed by Greptile